home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _53DF13FD61D447AE97135A6B4E43F8F3 < prev    next >
Encoding:
Text File  |  2004-01-06  |  643 b   |  22 lines

  1.  
  2.       #include "../CGVPMacro.csi"
  3.  
  4.  
  5.       VertAttributes { POSITION_3 PRIM_COLOR }
  6.       
  7.       MainInput { VIEWPROJ_MATRIX, CAMERA_POS, uniform float2x4 CaustTexGen, uniform float3 WaterLevel }
  8.       DeclarationsScript
  9.       {
  10.         IN_C0
  11.         OUT_T0_C0
  12.       }
  13.       PositionScript = PosCommon                 
  14.       CoreScript
  15.       {
  16.         OUT.Tex0.xy = mul(CaustTexGen, vPos);
  17.         
  18.         float fDistBlendFactor = vPos.w - length(vPos.xyz - CameraPos.xyz) * CameraPos.w;
  19.         OUT.Color.w = fDistBlendFactor * (float)((WaterLevel.x - vPos.z) >= vPos.w);
  20.         OUT.Color.xyz = IN.Color.w;
  21.       }
  22.